﻿using System;
using System.Collections.Generic;
using Autodesk.Revit.DB;
using YJKArchUtils.Utils;

namespace YJKRevitDimensionText.OneKeyPlanDim.Utility
{
	public class PointSort : IComparer<XYZ>
	{
		public int Compare(XYZ x, XYZ y)
		{
			if (x != null && y != null)
			{
				if (Geometry.LessThan(x.Y, y.Y))
				{
					return -1;
				}
				if (Geometry.IsEqual(x.Y, y.Y) && Geometry.LessThan(x.X, y.X))
				{
					return -1;
				}
			}
			return 0;
		}
	}
}
